# Copyright 2006 The Android Open Source Project

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
    ril.cpp \
    ril_event.cpp	\
	ril_util.c		\
	at_tok.c		\
	atchannel.c		\
	ppp_ctrl.c		\
	modem_usb.c		\
	sunxi_ril.c		\
	dongle.c		\
	dongle_client.c		\
	dongle_config.c		\
	dongle_util.c

LOCAL_SHARED_LIBRARIES := \
	libutils \
    libbinder \
    libcutils \
    libhardware_legacy

#LOCAL_STATIC_LIBRARIES := \
    libusb
LOCAL_LDFLAGS += $(LOCAL_PATH)/libusb.a

LOCAL_CFLAGS :=

#PRODUCT_COPY_FILES += \
	$(LOCAL_PATH)/libbroncho.so:system/lib/libbroncho.so


#if hardware flow
LOCAL_CFLAGS += -DUSE_CRTSCTS
LOCAL_CFLAGS += -DENABLE_LOG
LOCAL_CFLAGS += -I$(TOPDIR)hardware/libhardware_legacy/include/hardware_legacy 
#platform
LOCAL_CFLAGS += -DPLATFORM_A10
LOCAL_MODULE_TAGS = eng

LOCAL_MODULE:= libril

LOCAL_LDLIBS += -lpthread

include $(BUILD_SHARED_LIBRARY)


# For RdoServD which needs a static library
# =========================================
ifneq ($(ANDROID_BIONIC_TRANSITION),)
include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
    ril.cpp

LOCAL_STATIC_LIBRARIES := \
    libutils_static \
    libcutils

LOCAL_CFLAGS +=
LOCAL_CFLAGS += -I$(TOPDIR)hardware/libhardware_legacy/include/hardware_legacy 

LOCAL_MODULE:= libril_static

LOCAL_LDLIBS += -lpthread
LOCAL_MODULE_TAGS := optional

include $(BUILD_STATIC_LIBRARY)


endif # ANDROID_BIONIC_TRANSITION

include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
    ril.cpp \
    ril_event.cpp	\
	ril_util.c		\
	at_tok.c		\
	atchannel.c		\
	ppp_ctrl.c		\
	modem_usb.c		\
	sunxi_ril.c		\
	dongle.c		\
	dongle_client.c		\
	dongle_config.c		\
	dongle_util.c

LOCAL_SHARED_LIBRARIES := \
	libutils \
    libbinder \
    libcutils \
    libhardware_legacy

LOCAL_LDFLAGS += $(LOCAL_PATH)/libusb.a

#LOCAL_STATIC_LIBRARIES := \
    libusb

LOCAL_CFLAGS += -I$(TOPDIR)hardware/libhardware_legacy/include/hardware_legacy -I$(TOPDIR)hardware/ril/libril
#LOCAL_CFLAGS += -DUSE_HARDWARE -I$(TOPDIR)hardware/libhardware_legacy/include/hardware_legacy -I$(TOPDIR)hardware/ril/libril
# for asprinf
#LOCAL_CFLAGS += -D_GNU_SOURCE

#if hardware flow
#LOCAL_CFLAGS += -DENABLE_LOG
LOCAL_C_INCLUDES := $(KERNEL_HEADERS)

#build executable
LOCAL_MODULE:= dongle_test.dsds
LOCAL_MODULE_TAGS := eng 
include $(BUILD_EXECUTABLE)
